import { lazy } from "react";
import {RouterList} from "../utils/index"
import { FriendsO, HomeO, Search, SettingO } from '@react-vant/icons'
export let mainRouter:RouterList = [
    {
        path:"/index/home",
        element:lazy(() =>import("../pages/index/Home")),
        title:"Home",
        icon:<HomeO/>
    },
    {
        path:"/index/classify",
        element:lazy(() =>import("../pages/index/Classify")),
        title:"Classify",
        icon:<FriendsO/>
    },
    {
        path:"/index/shopcar",
        element:lazy(() =>import("../pages/index/Shopcar")),
        title:"Shopcar",
        icon:<Search/>,
        badge:true,
    },
    {
        path:"/index/my",
        element:lazy(() =>import("../pages/index/My")),
        title:"My",
        icon:<SettingO/>
    }
]
// @
const routes:RouterList = [
    {
        path:"/",
        to:"/index/home"
    },
    {
        path:"/index",
        element:lazy(() =>import("../pages/Index")),
        children:mainRouter

    },
    {
        path:"*",
        element:lazy(() =>import("../pages/Eorry404"))
    },
    {
        path:"/login",
        element:lazy(() =>import("../pages/Login"))
    },
    {
        path:"/details/:id",
        element:lazy(() =>import("../pages/Details"))
    }
]

export default routes